﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/MyLife/Views/Shared/_Layout.cshtml";
}
<style type="text/css">
    #editor
    {
        background-color: white;
        border: 1px solid #CCCCCC;
        border-collapse: separate;
        border-radius: 3px 3px 3px 3px;
        box-shadow: 0 1px 1px 0 #000000 inset;
        box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.075) inset;
        overflow: scroll;
        min-height: 300px;
        max-height: 600px;
        display: none;
    }
    #editorTool {
        display: none;
    }

    .btn-cur
    {
        -moz-border-bottom-colors: none;
        -moz-border-left-colors: none;
        -moz-border-right-colors: none;
        -moz-border-top-colors: none;
        border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) #B3B3B3;
        border-image: none;
        border-radius: 4px 4px 4px 4px;
        border-style: solid;
        border-width: 1px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
        color: #333333;
        cursor: pointer;
        display: inline-block;
        font-size: 14px;
        line-height: 20px;
        margin-bottom: 0;
        padding: 4px 12px;
        text-align: center;
        text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
        vertical-align: middle;
    }
</style>
<script src="~/Js/bootstrap-wysiwyg.js"></script>
<div class="span9">
    <div class="">
        <button class="btn-cur" onclick="addCon(event)"><h6>ADD</h6> </button>
    </div>

    <hr />

    <!-- Editor
        *********************************************************************************-->

    <div id=""></div>
    <div id="editorTool" data-target="#editor" data-role="editor-toolbar" class="btn-toolbar">
        <div class="btn-group">
            <a title="" data-toggle="dropdown" class="btn-cur dropdown-toggle" data-original-title="Font"><i class="icon-font"></i><b class="caret"></b></a>
            <ul class="dropdown-menu">
                <li><a style="font-family: 'Serif'" data-edit="fontName Serif">Serif</a></li>
                <li><a style="font-family: 'Sans'" data-edit="fontName Sans">Sans</a></li>
                <li><a style="font-family: 'Arial'" data-edit="fontName Arial">Arial</a></li>
                <li><a style="font-family: 'Arial Black'" data-edit="fontName Arial Black">Arial Black</a></li>
            </ul>
        </div>
        <div class="btn-group">
            <a title="" data-toggle="dropdown" class="btn-cur dropdown-toggle" data-original-title="Font Size"><i class="icon-text-height"></i>&nbsp;<b class="caret"></b></a>
            <ul class="dropdown-menu">
                <li><a data-edit="fontSize 5"><font size="5">Huge</font></a></li>
                <li><a data-edit="fontSize 3"><font size="3">Normal</font></a></li>
                <li><a data-edit="fontSize 1"><font size="1">Small</font></a></li>
            </ul>
        </div>
        <div class="btn-group">
            <a title="" data-edit="bold" class="btn-cur" data-original-title="Bold (Ctrl/Cmd+B)"><i class="icon-bold"></i></a>
            <a title="" data-edit="italic" class="btn-cur" data-original-title="Italic (Ctrl/Cmd+I)"><i class="icon-italic"></i></a>
        </div>
        <div class="btn-group">
            <a title="" data-edit="outdent" class="btn-cur" data-original-title="Reduce indent (Shift+Tab)"><i class="icon-indent-left"></i></a>
            <a title="" data-edit="indent" class="btn-cur" data-original-title="Indent (Tab)"><i class="icon-indent-right"></i></a>
        </div>
        <div class="btn-group">
            <a title="" data-edit="justifyleft" class="btn-cur btn-info" data-original-title="Align Left (Ctrl/Cmd+L)"><i class="icon-align-left"></i></a>
            <a title="" data-edit="justifycenter" class="btn-cur" data-original-title="Center (Ctrl/Cmd+E)"><i class="icon-align-center"></i></a>
            <a title="" data-edit="justifyright" class="btn-cur" data-original-title="Align Right (Ctrl/Cmd+R)"><i class="icon-align-right"></i></a>
            <a title="" data-edit="justifyfull" class="btn-cur" data-original-title="Justify (Ctrl/Cmd+J)"><i class="icon-align-justify"></i></a>
        </div>
        <div class="btn-group">
            <a id="pictureBtn" title="" class="btn-cur" data-original-title="Insert picture (or just drag &amp; drop)"><i class="icon-picture"></i></a>
            <input type="file" data-edit="insertImage" data-target="#pictureBtn" data-role="magic-overlay" style="opacity: 0; position: absolute; top: 0px; left: 0px; width: 41px; height: 30px;">
        </div>
        <div class="btn-group">
            <a title="" data-edit="undo" class="btn-cur" data-original-title="Undo (Ctrl/Cmd+Z)"><i class="icon-undo"></i></a>
            <a title="" data-edit="redo" class="btn-cur" data-original-title="Redo (Ctrl/Cmd+Y)"><i class="icon-repeat"></i></a>
        </div>
        <input type="text" x-webkit-speech="" id="voiceBtn" data-edit="inserttext" style="display: none;">
    </div>
    <div id="editor">
        Please code ....
    </div>

    <hr />

    <div class="row-fluid">
        <div class="span4">
            <h2>Heading</h2>
            <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
            <p><a href="#" class="btn">View details »</a></p>
        </div>
        <!--/span-->
        <div class="span4">
            <h2>Heading</h2>
            <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
            <p><a href="#" class="btn">View details »</a></p>
        </div>
        <!--/span-->
        <div class="span4">
            <h2>Heading</h2>
            <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
            <p><a href="#" class="btn">View details »</a></p>
        </div>
        <!--/span-->
    </div>
    <!--/row-->
    <div class="row-fluid">
        <div class="span4">
            <h2>Heading</h2>
            <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
            <p><a href="#" class="btn">View details »</a></p>
        </div>
        <!--/span-->
        <div class="span4">
            <h2>Heading</h2>
            <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
            <p><a href="#" class="btn">View details »</a></p>
        </div>
        <!--/span-->
        <div class="span4">
            <h2>Heading</h2>
            <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
            <p><a href="#" class="btn">View details »</a></p>
        </div>
        <!--/span-->
    </div>
    <!--/row-->
</div>
<!--/span-->

<script type="text/javascript">
    $().ready(
        function () {
            $('#editor').cleanHtml();
            $('#editor').wysiwyg();
            /*
            $('#addconBtn').click(function (e) {
                alert($(e.target).attr("class"));
            });
            */
        }
      );
    function addCon(e) {
        var classClose = 'btn-cur';
        var classOpen = 'btn-cur btn-info';
        var classStr = $(e.target).attr("class");

        if (classStr == classClose) {//打开
            $(e.target).attr("class", classOpen);
            $('#editorTool').show();
            $('#editor').show();

        } else {
            $(e.target).attr("class", classClose);
            
            $('#editorTool').hide();
            $('#editor').hide();
        }


    }
</script>
